Skip to content

Use current AKS Kubernetes version in generated config#200

Closed
bcho with Copilot wants to merge 3 commits into
mainfrom
copilot/generate-node-config-use-current-kubernetes-versio
Closed

Use current AKS Kubernetes version in generated config#200
bcho with Copilot wants to merge 3 commits into
mainfrom
copilot/generate-node-config-use-current-kubernetes-versio

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

generate-node-config was reading kubernetesVersion, which may be a major/minor alias like 1.34. aks-flex-node needs the resolved patch version, e.g. 1.34.8, to download Kubernetes binaries from dl.k8s.io.

  • Metadata lookup
    • Query currentKubernetesVersion from az aks show for components.kubernetes.
    • Avoid falling back to kubernetesVersion, which can produce non-downloadable versions.
"currentKubernetesVersion"

Copilot AI changed the title [WIP] Fix generate-node-config to use currentKubernetesVersion Use current AKS Kubernetes version in generated config Jun 19, 2026
Copilot finished work on behalf of bcho June 19, 2026 20:14
Copilot AI requested a review from bcho June 19, 2026 20:14
@bcho bcho marked this pull request as ready for review June 19, 2026 20:26
Copilot AI review requested due to automatic review settings June 19, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the aks-flex-config generate-node-config helper to always use the resolved AKS patch Kubernetes version (via currentKubernetesVersion) when generating the Flex Node config, ensuring downstream Kubernetes binary downloads can target a concrete version from dl.k8s.io.

Changes:

  • Switch cluster metadata lookup from currentKubernetesVersion || kubernetesVersion to currentKubernetesVersion only.
  • Add a focused Python unittest to assert metadata generation uses currentKubernetesVersion and preserves a full semver patch value.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
scripts/aks-flex-config Updates AKS metadata query to use currentKubernetesVersion for components.kubernetes.
scripts/aks_flex_config_test.py Adds a unit test validating the script queries currentKubernetesVersion and returns the patch version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/aks-flex-config
Comment on lines 138 to 141
"kubernetes_version": run(
["az", "aks", "show", *aks, "--query", "currentKubernetesVersion || kubernetesVersion", "-o", "tsv"],
["az", "aks", "show", *aks, "--query", "currentKubernetesVersion", "-o", "tsv"],
capture=True,
),
Comment thread scripts/aks_flex_config_test.py Outdated
Comment on lines +29 to +47
self.assertEqual(metadata["kubernetes_version"], "1.34.8")
run.assert_any_call(
[
"az",
"aks",
"show",
"--resource-group",
"rg",
"--name",
"cluster",
"--subscription",
"sub",
"--query",
"currentKubernetesVersion",
"-o",
"tsv",
],
capture=True,
)
Comment thread scripts/aks_flex_config_test.py Outdated
Comment on lines +1 to +6
import argparse
import importlib.machinery
import importlib.util
from pathlib import Path
import unittest
from unittest import mock
Comment thread scripts/aks_flex_config_test.py Outdated
@@ -0,0 +1,51 @@
import argparse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e283564: removed scripts/aks_flex_config_test.py.

Copilot finished work on behalf of bcho June 19, 2026 21:34
Copilot AI requested a review from bcho June 19, 2026 21:34
@bcho bcho closed this Jun 19, 2026
@bcho bcho deleted the copilot/generate-node-config-use-current-kubernetes-versio branch June 19, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate-node-config should use currentKubernetesVersion (not kubernetesVersion)

3 participants